package com.cskaoyan.catmall.model.vo;

import com.cskaoyan.catmall.model.pojo.MarketGoods;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 商品列表
 * 创建日期: 2022/01/06 23:48
 *
 * @author ghr
 */
@NoArgsConstructor
@Data
public class GoodsVo {
    private Integer page;
    private Integer pages;
    private Integer total;
    private Integer limit;
    private List<MarketGoods> list;

    public static GoodsVo goodsVo(long total, Integer pages, Integer limit, Integer page, List list) {
        GoodsVo goodsVo = new GoodsVo();
        goodsVo.setTotal((int) total);
        goodsVo.setLimit(limit);
        goodsVo.setPage(page);
        goodsVo.setPages(pages);
        goodsVo.setList(list);
        return goodsVo;
    }
}